﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Vision.Utilities.ConsoleApp
{
    public class TITANHelper
    {
        public static IEnumerable<string> GetCustomizationProjects()
        {
            //Smyrna, TN\Consulting\Specifications\ 
            var folder = @"Z:\Projects on Titan\";
            var customComponents = @"Site6\Customizations";
            var list = new List<string>();
            foreach (var directory in Directory.GetDirectories(folder))
            {
                var customComponentsFolder = Path.Combine(directory, customComponents);
                if (Directory.Exists(customComponentsFolder)
                 && (Directory.GetFiles(customComponentsFolder).Any()
                  || Directory.GetDirectories(customComponentsFolder).Any()))
                {
                    list.Add(customComponentsFolder);
                }
            }
            //using (var streamWriter = new StreamWriter(@"D:\a.txt", false))
            //{
            //    foreach (var project in list)
            //        streamWriter.WriteLine(project);
            //}
            return list;
        }
    }
}
